<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
/* ======================================================================*\
  || #################################################################### ||
  || # ND.Tiep CODER Tutorial                                           # ||
  || # ---------------------------------------------------------------- # ||
  || # Copyright ©2013 Nguyen Dinh Tiep. All Rights Reserved.           # ||
  || # Please do not remove this comment lines.                         # ||
  || # -------------------- LAST MODIFY INFORMATION ------------------- # ||
  || # Author by: Nguyen Dinh Tiep                                      # ||
  || #################################################################### ||
  \*====================================================================== */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*\
  |*-------Please specify source when using my code or a part of them-----*|
  \*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
class Bogo{
    function __construct() {
    }
    /**
     * 
     * @param string $type (Kiểu bộ gõ : ví dụ Chuẩn : chuan , Đầy đủ : full , nhỏ : nho)
     * 
     */
  
    public function bogo($select="textarea#bogo",$type="chuan",$statusbar='false'){
  
        $bogo = '<script type="text/javascript" src="'.__URL__.'/library/tinymce/js/tinymce/tinymce.min.js"></script>';
     if($type=="full"){
     $bogo .=   '<script type="text/javascript">
                        
                    tinymce.init({
                            selector: "'.$select.'",
                            theme: "modern",                        
                            plugins: [
                               "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                               "searchreplace wordcount visualblocks visualchars code fullscreen",
                               "insertdatetime nonbreaking save table contextmenu directionality",
                                "emoticons template textcolor autosave code quote textarea table snippet youtube quote insert_code"
                            ],
                            toolbar: "bold italic underline strikethrough | forecolor backcolor | snippet quote | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | styleselect | fontselect fontsizeselect removeformat | table | link unlink image youtube | charmap emoticons fullscreen | undo redo | preview",
                            menubar: "false",
                            height: 300,
                                entity_encoding : "raw",
                                add_unload_trigger : false,
                                language : "vi_VN",
                                remove_linebreaks : false,
                                inline_styles : false,
                                convert_fonts_to_spans : true,
                                forced_root_block : false,
                                statusbar : '.$statusbar.',
                                convert_urls: false,
                            document_base_url : "'.__URL__. '",
                        });
                        </script>';
    
    }elseif($type=="chuan"){
            $bogo .=   '<script type="text/javascript">
                        
                    tinymce.init({
                         
                            selector: "'.$select.'",
                            theme: "modern",                        
                            plugins: ["advlist autolink lists link image charmap print preview hr anchor pagebreak",
                               "searchreplace wordcount visualblocks visualchars code fullscreen",
                               "insertdatetime nonbreaking save table contextmenu directionality",
                                "emoticons template textcolor autosave code quote textarea table snippet youtube quote insert_code"
                            ],
                            toolbar: "bold italic underline | forecolor | snippet quote | aligncenter alignright  | bullist numlist | link unlink image youtube emoticons",
  
                            menubar: "false",
                             height: 150,
                           
                                entity_encoding : "raw",
                                add_unload_trigger : false,
                                language : "vi_VN",
                                remove_linebreaks : false,
                                inline_styles : false,
                                convert_fonts_to_spans : true,
                                forced_root_block : false,
                                statusbar : '.$statusbar.',
                                convert_urls: false,
                                document_base_url : "' . URL . '",
                        });
                        </script>';
    }elseif($type=="nho"){
            $bogo .=   '<script type="text/javascript">
                        
                    tinymce.init({
                         
                            selector: "'.$select.'",
                            theme: "modern",                        
                            plugins: ["advlist autolink lists link image charmap print preview hr anchor pagebreak",
                               "searchreplace wordcount visualblocks visualchars code fullscreen",
                               "insertdatetime nonbreaking save table contextmenu directionality",
                                "emoticons template textcolor autosave code quote textarea table snippet youtube quote insert_code"
                            ],
                            toolbar: "bold italic underline | forecolor emoticons",
  
                            menubar: "false",
                             height: 120,
                           
                                entity_encoding : "raw",
                                add_unload_trigger : false,
                                language : "vi_VN",
                                remove_linebreaks : false,
                                inline_styles : false,
                                convert_fonts_to_spans : true,
                                forced_root_block : false,
                                statusbar : '.$statusbar.',
                                convert_urls: false,
                                document_base_url : "' . URL . '",
                        });
                        </script>';
    }
     return $bogo;
    }
}

